package cn.com.pingtech.slave.service;

import cn.com.pingtech.master.domain.MasterModel;
import cn.com.pingtech.master.service.MasterService;
import cn.com.pingtech.slave.domain.SlaveModel;
import cn.com.pingtech.slave.mapper.SlaveMapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhusy
 * @description MasterService
 * @date 2021/1/7 17:12
 */
@Service
@DS("slave")
public class SlaveService {

    @Autowired
    SlaveMapper masterMapper;

    @Autowired
    MasterService masterService;
    public List<SlaveModel> list(){
        Wrapper wrapper = new QueryWrapper<SlaveModel>();
        List<SlaveModel> list = masterMapper.selectList(wrapper);

        List<MasterModel> masterList = masterService.list();
        System.out.println(masterList);
        return list;
    }
}
